package user

import (
	"time"
	"wzgames/internal/model/mcomm"
)

// wallet.sql

type WalletEntity struct {
	Uid     uint64    `db:"uid" json:"uid"`
	AgtId   int64     `db:"agtid" json:"agtid"`
	CurrID  int32     `db:"currid" json:"currid"`
	Curr    string    `db:"curr" json:"curr"`
	Balance string    `db:"balance" json:"balance"`
	Wv      int64     `db:"wv" json:"wv"`
	Created time.Time `db:"created" json:"created"`
	Updated time.Time `db:"updated" json:"updated"`
}

type WalletTxHash struct {
	FromId string `db:"fromid"`
	TxId   uint64 `db:"tid"`
}

type WalletTransfer struct {
	TxId     uint64             `db:"tid"`
	Uid      uint64             `db:"uid"`
	AgtId    int64              `db:"agtid"`
	AgtUid   string             `db:"agtuid"`
	Uname    string             `db:"uname"`
	CurrID   int32              `db:"currid"`
	UCurr    string             `db:"ucurrency"`
	AcType   mcomm.WalletAction `db:"actype"`
	Status   mcomm.AcStatus     `db:"status"`
	Amount   string             `db:"amount"`
	Balance  string             `db:"balance"`
	OBalance string             `db:"obalance"`
	FromId   string             `db:"fromid"`
	Created  time.Time          `db:"created"`
	Updated  time.Time          `db:"updated"`
}

type WalletBetCharge struct {
	BetId   uint64    `db:"betid"`
	InstId  int64     `db:"inst"`
	Uid     uint64    `db:"uid"`
	CurrId  int32     `db:"currid"`
	GameId  int32     `db:"gameid"`
	BetAmt  string    `db:"betamt"`
	EffAmt  string    `db:"effamt"`
	Fee     string    `db:"fee"`
	BetTime int64     `db:"bettime"`
	Balance string    `db:"balance"`
	Wv      int64     `db:"wv"`
	Created time.Time `db:"created"`
	Updated time.Time `db:"updated"`
}

type WalletBetPayout struct {
	BetId   uint64           `db:"betid"`
	Win     mcomm.GameResult `db:"win"`
	Amt     string           `db:"amt"`
	GAct    mcomm.GameAction `db:"gact"`
	PayTime int64            `db:"paytime"`
	Created time.Time        `db:"created"`
	Updated time.Time        `db:"updated"`
}

type WalletBetCancel struct {
	BetId    uint64    `db:"betid"`
	Amt      string    `db:"amt"`
	Dateline int64     `db:"dateline"`
	Created  time.Time `db:"created"`
	Updated  time.Time `db:"updated"`
}

type WalletBetPending struct {
	BetId   uint64           `db:"betid" json:"betid"`
	NodeId  int64            `db:"nodeid" json:"nodeid"`
	GAct    mcomm.GameAction `db:"gact" json:"gact"`
	Stm     int8             `db:"stm" json:"stm"`
	BetTime int64            `db:"bettime" json:"bettime"`
	Uid     uint64           `db:"uid" json:"uid"`
	CurrId  int32            `db:"currid" json:"currid"`
	GameId  int32            `db:"gameid" json:"gameid"`
	RoundId int64            `db:"roundid" json:"roundid"`
	BetAmt  string           `db:"betamt" json:"betamt"`
	EffAmt  string           `db:"effamt" json:"effamt"`
	Fee     string           `db:"fee" json:"fee"`
	InstId  int64            `db:"inst" json:"inst"`
}
